package com.briup.cms.service.impl;

import com.briup.cms.bean.Role_Privilege;
import com.briup.cms.dao.Role_PrivilegeMapper;
import com.briup.cms.service.IRole_PrivilegeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Role_PrivilegeServiceImpl implements IRole_PrivilegeService {

    @Resource
    private Role_PrivilegeMapper role_privilegeMapper;

    @Override
    public List<Role_Privilege> findAll() {

        return role_privilegeMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(Role_Privilege role_privilege) {
        if(role_privilege.getId()!=null){
            role_privilegeMapper.update(role_privilege);
        }else{
            role_privilegeMapper.insert(role_privilege);
        }
    }

    @Override
    public void deleteById(long id) {

        role_privilegeMapper.deleteById(id);

    }
}
